<%@page import="com.Service.BO.TeamBO"%>
<%@page import="com.Service.BO.DepartmentBO"%>
<%@page import="com.Service.BO.CountryBO"%>
<%@page import="com.Service.BO.OrganizationBO"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.List"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>Create Departments</title>
        <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
        <style media="all" type="text/css">
            @import "css/all.css";.MandatoryColour {
                color: #F00;
            }
            .MandatoryColour {
                color: #F00;
            }
            .MandatoryColour {
                color: #F00;
            }
            #main #middle #center-column form .listing.form .bg .first #TabbedPanels2 .TabbedPanelsContentGroup .TabbedPanelsContent.TabbedPanelsContentVisible table {
                text-align: left;
            }
            #main #middle #center-column form .listing.form .bg .first #TabbedPanels2 .TabbedPanelsContentGroup .TabbedPanelsContent.TabbedPanelsContentVisible table {
                text-align: left;
            }
            #main #middle #center-column form .listing.form .bg .first #TabbedPanels2 .TabbedPanelsContentGroup .TabbedPanelsContent.TabbedPanelsContentVisible table tr td #description {
                text-align: left;
            }
            #main #middle #center-column form .listing.form .bg .first #TabbedPanels2 .TabbedPanelsContentGroup .TabbedPanelsContent.TabbedPanelsContentVisible table tr td {
                font-size: 10px;
                text-align: left;
                font-weight: bold;
            }
            #main #middle #center-column form .listing.form .bg .first #TabbedPanels2 .TabbedPanelsContentGroup .TabbedPanelsContent.TabbedPanelsContentVisible table {
                text-align: left;
                float: none;
                font-weight: bold;
            }
            .TableHeading {
                font-weight: bold;
                font-variant: normal;
            }
            #main #middle #center-column form .listing.form .bg .first #TabbedPanels1 .TabbedPanelsContentGroup .TabbedPanelsContent.TabbedPanelsContentVisible table tr .normal {
                font-weight: normal;
            }
        </style>
        <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
        <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
    </head>
    <body>
        <div id="main">

            <div id="header">
                <a href="index.html" class="logo"><img src="img/logo.png" width="954" height="112" alt="" /></a>


            </div>
            <div id="middle">
                <div id="left-column">
                    <h3>Home</h3>
                    <ul class="nav">
                        <li><a href="ListOrganController">Organization</a></li>
                        <li></li>
                        <li><a href="Services.jsp">Services</a></li>
                        <li><a href="Premises.jsp">Premises</a></li>
                        <li><a href="#">Forum</a>			    </li>
                        <li class="last"><a href="#">Fsoft Mail</a></li>
                    </ul>
                    <h3>Geograpphy</h3>
                    <ul class="nav">
                        <li><a href="TRegion.jsp">Trust region</a></li>

                        <li><a href="GovRegion.jsp">Government Region</a></li>
                    </ul>
                    <a href="#" class="link">Help</a>
                    <a href="index.jsp" class="link">Logout</a>
                </div>
                <div></div>
                <script type="text/javascript">
                    function ValidateDirect()
                    {
                        var a = document.forms["dire"]["dirname"].value;
                        var b = document.forms["dire"]["addline1"].value;
                        var c = document.forms["dire"]["postcode"].value;
                        var d = document.forms["dire"]["type"].value;
                        
                        if(a == "" || a == null)
                        {
                            alert("Directorate Name Field Cannot Be Left Blank");
                            return false;
                        }
                        else if(b == "" || b == null)
                        {
                            alert("Address Line1 Field Cannot Be Left Blank ");
                            return false;
                        }
                        else if(c == "" || c == null)
                        {
                            alert("Post Code Field Cannot Be Left Blank");
                            return false;
                        }
                        else if(d == "" || d == null)
                        {
                            alert("Type Of Business Must Be Filled");
                            return false;
                        }
                    }
                </script>
                <div id="center-column"><br />
                    <form id="dire" name="dire" action="AddDirectorateController" method="get" onsubmit="return ValidateDirect()">
                        <div class="table">
                            <img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
                            <img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
                            <table width="588" height="82" cellpadding="0" cellspacing="0" class="listing form">
                                <tr>
                                    <th class="full">business unit / directory</th>
                                </tr>
                                <tr class="bg">
                                    <td height="29" class="first"><div id="TabbedPanels1" class="TabbedPanels">
                                            <ul class="TabbedPanelsTabGroup">
                                                <li class="TabbedPanelsTab" tabindex="0">Details</li>
                                                <li class="TabbedPanelsTab" tabindex="0">Departments</li>
                                                <li class="TabbedPanelsTab" tabindex="0">Teams</li>
                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                <input type="submit" name="save" id="save" value="save" />
                                                <input type="checkbox" name="Inactive" id="Inactive" />
                                                <label for="Inactive">include In-Active </label>
                                            </ul>
                                            <div class="TabbedPanelsContentGroup">
                                                <div class="TabbedPanelsContent">
                                                    <table width="582" border="0" cellspacing="2" cellpadding="2">
                                                        <tr>
                                                            <td width="132" class="normal">BU /Directorate Name : *</td>
                                                            <td width="159"><label for="url"></label>
                                                                <input type="text" name="dirname" id="dirname" /></td>
                                                            <td width="89" class="normal">Type Of Business :<span class="MandatoryColour">*</span></td>
                                                            <td width="173"><label for="type"></label>
                                                                <input name="type" type="text" id="type" size="16" />
                                                                <a href="SearchbusinessType.html" class="normal">Look up</a></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">BU/Directorate Short Desc :</td>
                                                            <td><label for="description"></label>
                                                                <textarea name="desc" id="desc" cols="25" rows="3"></textarea></td>
                                                            <td class="normal">BU/Directorate Full Desc :</td>
                                                            <td><label for="full">
                                                                    <textarea name="full" id="full" cols="25" rows="3"></textarea>
                                                                </label></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">Lead Contact :</td>
                                                            <td><label for="type"></label>
                                                                <label for="leadcontact"></label>
                                                                <input name="leadcontact" type="text" id="leadcontact" size="17" />
                                                                <span class="normal">L <a href="searchContact.html">ook Up</a></span></td>
                                                            <td class="normal">SIC Code :</td>
                                                            <td><input type="text" name="code" id="code" /></td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="2" class="normal"><input type="checkbox" name="copy" id="copy" />
                                                                <label for="copyAddress">Copy Address from organization </label></td>
                                                            <td class="normal">Phone Number:</td>
                                                            <td><label for="phone"></label>
                                                                <input type="text" name="phone" id="phone" /></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">Address Line 1 :<span class="MandatoryColour">*</span></td>
                                                            <td><label for="addline1"></label>
                                                                <input type="text" name="addline1" id="addline1" /></td>
                                                            <td class="normal">Fax :</td>
                                                            <td><label for="fax"></label>
                                                                <input type="text" name="fax" id="fax" /></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">Address Line 2</td>
                                                            <td><label for="addline2"></label>
                                                                <input type="text" name="addline2" id="addline2" /></td>
                                                            <td class="normal">Email :</td>
                                                            <td><label for="email"></label>
                                                                <input type="text" name="email" id="email" /></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">Address Line 3</td>
                                                            <td><label for="addline3"></label>
                                                                <input type="text" name="addline3" id="addline3" /></td>
                                                            <td class="normal">Web Address</td>
                                                            <td><label for="webAdd"></label>
                                                                <input type="text" name="webAdd" id="webAdd" /></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">Postcode :<span class="MandatoryColour"> *</span></td>
                                                            <td><label for="postcode"></label>
                                                                <input name="postcode" type="text" id="postcode" size="17" />
                                                                <a href="Searchpostcode.html" class="normal">Look Up</a></td>

                                                            <td>Organization Name : </td>
                                                            
                                                            <td><label for="orgname"></label>

                                                                <select name="orgname" id="orgname" >
                                                                    <option>Select</option>

                                                                    <%
                                                                        List gist = (List) request.getAttribute("ListOrgan");
                                                                        Iterator ite = gist.iterator();
                                                                        while (ite.hasNext()) {
                                                                            OrganizationBO org = (OrganizationBO) ite.next();
                                                                            String name = org.getName();
                                                                            int id = org.getId();
                                                                    %> 

                                                                    <option value="<%= id%>" ><%= name%></option>
                                                                    <%
                                                                        }
                                                                    %> 
                                                                </select></td>
                                                            <td class="normal">&nbsp;</td>
                                                            <td>&nbsp;</td>
                                                            <tr>
                                                                <td class="normal">Town/Village/City</td>
                                                                <td><label for="city"></label>
                                                                    <input type="text" name="city" id="city" /></td>

                                                                <td class="normal">Charity Number :</td>
                                                                <td><label for="char"></label>
                                                                    <input type="text" name="char" id="char" /></td>
                                                                <td class="normal">&nbsp;</td>
                                                                <td>&nbsp;</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="normal">County</td>
                                                                <td><label for="county"></label>
                                                                    <input type="text" name="county" id="county" /></td>

                                                                <td class="normal">Company Number :</td>
                                                                <td><label for="com"></label>
                                                                    <input type="text" name="com" id="com" /></td>
                                                                <td class="normal">&nbsp;</td>
                                                                <td>&nbsp;</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="normal">Nation/Country</td>
                                                                <td><label for="country"></label>
                                                                    <select name="country" id="country">
                                                                        <option>Select</option>
                                                                        <%
                                                                            List<CountryBO> bist = (List) request.getAttribute("ListCountry");
                                                                            if (bist != null) {

                                                                                for (CountryBO bo : bist) {
                                                                        %>
                                                                        <option value="<%= bo.getID()%>"><%= bo.getCountryName()%></option>
                                                                        <%
                                                                                }
                                                                            }
                                                                        %>
                                                                    </select></td>
                                                                <td class="normal">&nbsp;</td>
                                                                <td>&nbsp;</td>
                                                            </tr>
                                                            
                                                    </table>
                                                </div>
                                                <div class="TabbedPanelsContent">
                                                    <table width="577" border="0" cellspacing="2" cellpadding="2">
                                                        <form id="Dep" name="Dep" method="get" action="DepLoaderController">
                                                            <tr>
                                                                <td colspan="5">

                                                                    <span class="first style1"><a href = "" style = "text-decoration: none; font-weight: normal;">All</a> 
                                                                        <a href = "" style = "text-decoration: none; font-weight: normal;">| 0-9 </a> 
                                                                        <a href = "" style = "text-decoration: none; font-weight: normal;">| A B C D E</a> 
                                                                        <a href = "" style = "text-decoration: none; font-weight: normal;">| F G H I J </a> 
                                                                        <a href = "" style = "text-decoration: none; font-weight: normal;"> | K L M N </a>
                                                                        <a href = "" style = "text-decoration: none; font-weight: normal;">| O P Q R </a>
                                                                        <a href = "" style = "text-decoration: none; font-weight: normal;">| S T U V </a>
                                                                        <a href = "" style = "text-decoration: none; font-weight: normal;">| W X Y Z</a> | 
                                                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                        <input type="submit" name="Create" id="Create" value="Create" />
                                                                        <input type="checkbox" name="Inactive" id="Inactive" />
                                                                        <label for="Inactive">include In-Active </label>
                                                                    </span>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td width="197" class="TableHeading">Department Name</td>
                                                                <td width="123">Address Line 1</td>
                                                                <td width="76">Post Code</td>
                                                                <td width="85">Contact</td>
                                                                <td width="64">Is Active?</td>
                                                            </tr>
                                                            <%
                                                                List jist = (List) request.getAttribute("ListDepart");
                                                                Iterator kit = jist.iterator();
                                                                while (kit.hasNext()) {

                                                                    DepartmentBO dep = new DepartmentBO();
                                                                    String name = dep.getName();
                                                                    String addline1 = dep.getAddline1();
                                                                    String code = dep.getPostcode();
                                                                    String con = dep.getLead();
                                                                    String is = dep.getIsActive();
                                                            %>
                                                            <tr>
                                                                <td><span class="normal"></span></td>
                                                                <td><span class="normal"></span></td>
                                                                <td><span class="normal"></span></td>
                                                                <td><span class="normal"></span></td>
                                                                <td><span class="normal"></span></td>
                                                            </tr>
                                                            <%
                                                                }
                                                            %>

                                                        </form>
                                                    </table>
                                                </div>
                                                <div class="TabbedPanelsContent">
                                                    <table width="577" border="0" cellspacing="2" cellpadding="2">
                                                        <form id="team" name="team" method="get" action="TeamLoaderController">
                                                            <tr>
                                                                <td colspan="5"><span class="first style1"><a href = "" style = "text-decoration: none; font-weight: normal;">All</a>
                                                                        <a href = "" style = "text-decoration: none; font-weight: normal;">| 0-9 </a> 
                                                                        <a href = "" style = "text-decoration: none; font-weight: normal;">| A B C D E</a> 
                                                                        <a href = "" style = "text-decoration: none; font-weight: normal;">| F G H I J </a> 
                                                                        <a href = "" style = "text-decoration: none; font-weight: normal;"> | K L M N </a> 
                                                                        <a href = "" style = "text-decoration: none; font-weight: normal;">| O P Q R </a> 
                                                                        <a href = "" style = "text-decoration: none; font-weight: normal;">| S T U V </a> 
                                                                        <a href = "" style = "text-decoration: none; font-weight: normal;">| W X Y Z</a> |  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                        <input type="submit" name="Create2" id="Create2" value="Create" />
                                                                        <input type="checkbox" name="Inactive2" id="Inactive2" />
                                                                        <label for="Inactive2">include In-Active </label>
                                                                    </span></td>
                                                            </tr>
                                                            <tr>
                                                                <td width="197" class="TableHeading">Team Name</td>
                                                                <td width="123">Address Line 1</td>
                                                                <td width="76">Post Code</td>
                                                                <td width="85">Contact</td>
                                                                <td width="64">Is Active?</td>
                                                            </tr>
                                                            <%
                                                                List test = (List) request.getAttribute("ListTeam");
                                                                Iterator tet = test.iterator();
                                                                while (tet.hasNext()) {

                                                                    TeamBO tem = (TeamBO) tet.next();
                                                                    String tname = tem.getName();
                                                                    String tadd = tem.getAddline1();
                                                                    String tpost = tem.getPostcode();
                                                                    String tcon = tem.getLead();
                                                                    String tis = tem.getIsActive();
                                                            %>
                                                            <tr>
                                                                <td><span class="normal"><%= tname%></span></td>
                                                                <td><span class="normal"><%= tadd%></span></td>
                                                                <td><span class="normal"><%= tpost%></span></td>
                                                                <td><span class="normal"><%= tcon%></span></td>
                                                                <td><span class="normal"><%= tis%></span></td>
                                                            </tr>
                                                            <%
                                                                }
                                                            %>
                                                        </form>
                                                    </table>
                                                </div>
                                            </div>
                                        </div></td>
                                </tr>
                                <tr class="bg">
                                    <td class="first">
                                        <form id="buback" name="buback" method="get" action="SpecialismController">
                                            <input type="submit" name="Back" id="Back" value="Back" /></td>
                                   
                                </tr>
                            </table> </form>
                            <p>&nbsp;</p>
                        </div>
                </div>
                <div id="right-column">
                    <strong class="h">INFO</strong>
                    <div class="box">This screen is use to add supporting materials for organization</div>
                </div>
            </div>
            <div id="footer">
                <p>&nbsp;</p>
                <p>&nbsp;</p>
            </div>
        </div>
        <script type="text/javascript">
            var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
        </script>
    </body>
</html>
